<!--
- Author:   .
- Date:    2018/1/19 0019.
- File:    充值.
-->
<template>
  <div>
    <div class="Withdrawals">
      <ul>
        <p class="pl20" style="line-height: 35px;">当前账户经验值: <span>{{memberInfo.balance}}</span></p>
        <li><label><span class="nim">充值金额</span><input type="tel" placeholder="请输入充值金额" v-model="amount"></label></li>
      </ul>
    </div>
    <div class="pl20 pr20 mt35">
      <a class="but_1 wauto disb tc" @click="charge">提交</a>
    </div>
    <back-nav></back-nav>
    <footer-tab></footer-tab>
  </div>
</template>

<script>
  import {mapModules, mapRules} from 'vuet'
  import payPop from '../../../components/payPop'

  export default{
    mixins: [
      mapModules({memberInfo: 'memberInfo'}),
      mapRules({need: ['memberInfo']})
    ],
    data() {
      return {
        amount: ''
      }
    },
    components: {},
    methods: {
      charge() {
        if (this.memberInfo.member_state == '0') {
          this.$toast('该用户已被冻结，请联系客服')
          return
        }
        if (!this.amount || parseFloat(this.amount) <= 0) {
          this.$toast('请输入正确的充值金额')
          return
        }
        payPop({amount: this.amount, type: '2'})
        // this.$native.weixinPayCharge({amount: this.amount}).then(data => {})
      }
    }
  }
</script>

<style>

</style>